@extends('front.common.header')

@section('title',count($now_cate)>0?$now_cate->cat_name.' - 推荐机构 - 充电加油':'推荐机构 - 充电加油')
@section('description',(count($now_cate)>0 && !empty($now_cate->description)?trim($now_cate->description).',':''))
@section('keywords',(count($now_cate)>0&&!empty($now_cate->identify)?trim($now_cate->identify).',':'食品雕刻,复旦管理中心,扬州佰亿美容,杭州培森教育咨询,杭州智赢语言,成人高考,公务员培训,职业培训,高薪就业等领域,'))
@section('head')
    @parent
    @stop

@section('content')
<link rel="stylesheet" type="text/css" href="{{ asset('/css/teaches/charge.css') }}" >
<link rel="stylesheet" type="text/css" href="{{ asset('/css/employ/list.css') }}" />
<div class="charge">

    <div class="content">
        <div class='top-nav'>
    		<ul>
    		  {!! $mianbaoxie !!}
    		</ul>
    	</div>
    </div>

    <div class="charge-body">

        <div class="charge-left float-l">
            <div class="employ-search">
	           <div class="search-line" id="search-line">
	               <ul class="clearfix">
	                   <li class="fist-title">学习方向：</li>
	                   <li class="list-nav">
	                       <a href="">充电加油</a>
	                   </li>
	                   <li class="">
	                       <a href="{{url('employ/list')}}">就业指南</a>
	                   </li>
	               </ul>
	           </div>
	           <div class="search-line bodertop" id="search-line">
	               <ul class="clearfix">
	                   <li class="fist-title">板块分类：</li>
	                   <li @if($id == 1)class="list-nav"@endif>
	                       <a href="{{url('/teaches/list/1')}}">职业技能</a>
	                   </li>
	                   <li @if($id == 2)class="list-nav"@endif>
	                       <a href="{{url('/teaches/list/2')}}">推荐机构</a>
	                   </li>
	                   <li @if($id == 3)class="list-nav"@endif>
	                       <a href="{{url('/teaches/list/3')}}">企业专区</a>
	                   </li>
	               </ul>
	           </div>
	           <div class="search-line bodertop" id="search-line">
	               <ul class="clearfix">
	                   <li class="fist-title">行业分类：</li>
	                   <li  @if($lastid == 0 || empty($lastid))class="list-nav"@endif>
	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword)}}">全部</a>
	                   </li>
	                   @foreach($category as $key=>$cate)
	                   @if($key<7)
	                   <li id="select-lined" @if( $lastid == $cate->cat_id )class="list-nav"@endif>
	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$cate->cat_id.'&areaid='.$now_area)}}">{{$cate->cat_name}}</a>
	                   </li>
	                   @endif
	                   @if($key>=7 && ($lastid == $cate->cat_id))
                        <li class="list-nav" >
                           <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$cate->cat_id.'&areaid='.$now_area)}}">{{$cate->cat_name}}</a>
                       </li>
                       @endif
	                   @endforeach
	                   @if(count($category)>7)
	                   <div class="float-r has-more position-relative">
	                       <div class="icon-img">
	                           <img src="{{asset('images/front/more.png')}}">
                           </div>
            	           <div class="search-line to-more-infomation" id="to-more-infomation">
            	               <ul class="clearfix boderbtm-dashed">
            	                   <li class="fist-title">行业分类：</li>
            	                   <li  @if($lastid == 0 || empty($lastid))class="list-nav"@endif>
            	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword)}}">全部</a>
            	                   </li>
            	                   @foreach($category as $key=>$cate)
            	                   @if($key<7)
            	                   <li id="select-lined" @if( $lastid == $cate->cat_id )class="list-nav"@endif>
            	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$cate->cat_id.'&areaid='.$now_area)}}">{{$cate->cat_name}}</a>
            	                   </li>
            	                   @endif
            	                   @if($key>=7 && ($lastid == $cate->cat_id))
                                    <li class="list-nav" >
                                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$cate->cat_id.'&areaid='.$now_area)}}">{{$cate->cat_name}}</a>
                                   </li>
                                   @endif
            	                   @endforeach
            	               </ul>
            	               <ul class="clearfix">
            	                   @foreach($category as $cate)
            	                   @if(count($category)>=7)
            	                   <li id="select-lined" @if( $lastid == $cate->cat_id )class="list-nav"@endif>
            	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$cate->cat_id.'&areaid='.$now_area)}}">{{$cate->cat_name}}</a>
            	                   </li>
            	                   @endif
            	                   @endforeach
            	               </ul>
            	           </div>
	                   </div>
	                   @endif
	               </ul>
	           </div>
	           <div class="search-line bodertop" id="search-line">
	               <ul class="clearfix">
	                   <li class="fist-title">选择地区：</li>
	                   <li  @if(empty($now_area))class="list-nav"@endif>
	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid=0&sort='.$sort)}}">全部</a>
	                   </li>
	                   @foreach($areas as $key=>$area)
	                   @if($key < 9)
	                   <li @if($now_area == $area->area_id) class="list-nav" @endif>
	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid='.$area->area_id.'&sort='.$sort)}}">{{$area->title}}</a>
	                   </li>
	                   @endif
	                   @if($key>=9 && ($now_area == $area->area_id))
                        <li class="list-nav" >
                           <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid='.$area->area_id.'&sort='.$sort)}}">{{$area->title}}</a>
                       </li>
                       @endif
	                   @endforeach
	                   @if(count($areas)>9)
	                   <div class="float-r has-more position-relative" id="has-more">
	                       <div class="icon-img">
	                           <img src="{{asset('images/front/more.png')}}">
                           </div>
            	           <div class="search-line to-more-infomation" id="to-more-infomation">
            	               <ul class="clearfix boderbtm-dashed">
            	                   <li class="fist-title">选择地区：</li>
            	                   <li  @if(empty($now_area))class="list-nav"@endif>
            	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid=0&sort='.$sort)}}">全部</a>
            	                   </li>
            	                   @foreach($areas as $key=>$area)
            	                   @if($key < 9)
            	                   <li @if($now_area == $area->area_id) class="list-nav" @endif>
            	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid='.$area->area_id.'&sort='.$sort)}}">{{$area->title}}</a>
            	                   </li>
            	                   @endif
            	                   @if($key>=9 && ($now_area == $area->area_id))
                                    <li class="list-nav" >
                                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid='.$area->area_id.'&sort='.$sort)}}">{{$area->title}}</a>
                                   </li>
                                   @endif
            	                   @endforeach
            	               </ul>
            	               <ul class="clearfix">
            	                   @foreach($areas as $key=>$area)
            	                   @if($key >= 9)
            	                   <li @if($now_area == $area->area_id) class="list-nav" @endif>
            	                       <a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid='.$area->area_id.'&sort='.$sort)}}">{{$area->title}}</a>
            	                   </li>
            	                   @endif
            	                   @endforeach
            	               </ul>
            	           </div>
	                   </div>
	                   @endif
	               </ul>
	           </div>
	       </div>

            <div class="employ-search employ-sort mt-15">
              <div class="search-line">
	           <ul class="clearfix">
                   <li class="@if(empty($sort) || $sort ==  0) list-nav @endif"><a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid='.$now_area.'&sort=0')}}">综合排序</a></li>
                   <li>|</li>
                   <li class="@if($sort == 1) list-nav @endif"><a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid='.$now_area.'&sort=1')}}">浏览人数</a></li>
                   <li>|</li>
                   <li class="@if($sort == 2) list-nav @endif"><a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid='.$now_area.'&sort=2')}}">评论人数</a></li>
                   <li>|</li>
                   <li class="@if($sort == 3) list-nav @endif"><a href="{{url('/teaches/list/'.$id.'?kw='.$comkeyword.'&lastid='.$lastid.'&areaid='.$now_area.'&sort=3')}}">课程数</a></li>
               </ul>
             </div>
	       </div>
            <div class="charge-l-three  mt-15">        
              @foreach($organizationList as $org)  
                <div class="charge-three fl">
                    <div>
                        <span class="charge-three-img">
                            <a href="{{url('/teaches/organization/'.$org->id)}}">
                                <img src="{{count($org->attachment)>0?image_resize($org->attachment->url,218,132):asset('/images/t-nopic.jpg')}}" width="218" height="132">
                            </a>
                        </span>
                    </div>
                    <div>
                        <a href="{{url('/teaches/organization/'.$org->id)}}"><span class="introduction">{!!str_limit($org->name,22)!!}</span></a>
                    </div>
                    <ul class="charge-three-tp" style="margin:0;padding:0">
                        <li class="fl" style="width:50%">
                            <img src="{{asset('images/front/neweye.png')}}" style="margin-top:2px;">
                            &nbsp;&nbsp;{{$org->views_num}}
                        </li>
                        <li class="fl" style="width:50%">
                            <img src="{{asset('/images/front/newchat.png')}}" style="margin-top:2px;">
                            &nbsp;&nbsp;{{$org->comments_num}}
                        </li>
                    </ul>
                     <ul class="" style="margin-top:2px">
                         <li class="mf fl">课程数：<span  style="color:orange">{{ $org->class_count }}</span> </li>
                        <li class="fl" style="margin-left:10px">|</li>
                        <li class="bgrj fl">{{ count($org->cityName)?$org->cityName->title:'南京' }}</li>
                    </ul>
                     <div class="clearfix"></div> 
                </div> 
                @endforeach
             
            </div>
               <div class="charge-foot fl">
                    @if($org_num > 12)
                    <div class="charge-footer">
                        <a href="javascript:void(0);" id="getMores">继续加载.....</a>
                        <input type="hidden" name="pages" value="{{$pages}}" />
                    </div>
                    @else
                     <div class="charge-footer">
                        <a href="javascript:void(0);">没有更多数据</a>
                    </div>
                    @endif
                </div>
        </div>
    <script>
        $(function(){
            $('#getMores').click(function(){
                var p = $("input[name=pages]").val();
                var cateid = "{{ Input::get('cateid')}}";
                var lastid = "{{ Input::get('lastid')}}";
                var areaid = "{{ Input::get('areaid')}}";
                var sort = "{{Input::get('sort')}}"
                $.ajax({
                    type:'GET',
    	            url:'/teaches/list/2',
    	            data:"page="+p+"&kw="+'{{$comkeyword}}'+"&areaid="+areaid+"&lastid="+lastid+"&sort="+sort,
    	            dataType:'json',
                    success:function(data){
                        if(data.status == 'success'){
                            var result = data.data;
                            var str = '';
                            var html = '';
                            var imgurl='';
                            $.each(result,function(k,e){
                            	if(e.cityName != null){
                            		html = e.cityName.title;
                                }else{
                                	html ='南京';
                                }
                                if(e.attachment != null && e.attachment != 'undefined' ){
                                	imgurl = e.attachment.url;
                                }else{
                                    imgurl = '/images/t-nopic.jpg';
                                }
                                var sname = e.name;
                                if(sname.length > 12){
                                	sname = sname.substring(0,12)+"...";
                                }
                                str +='<div class="charge-three fl">'
                                    +'	<div>'
                                    +'        <span class="charge-three-img">'
                                    +'           <a href="/teaches/organization/'+e.id+'"><img src="'+imgurl+'" width="218" height="136"></a>'
                                    +'      </span>'
                                    +'  </div>'
                                    +'  <div>'
                                    +'      <a href="/teaches/organization/'+e.id+'"><span class="introduction">'+sname+'</span></a>'
                                    +'  </div>'
                                    +'  <ul class="charge-three-tp" style="margin:0;padding:0">'
                                    +'      <li class="fl" style="width:50%">'
                                    +'          <img src="/images/front/neweye.png" style="margin-top:2px;">'
                                    +'          &nbsp;&nbsp;0'+e.views_num
                                    +'      </li>'
                                    +'      <li class="fl" style="width:50%">'
                                    +'           <img src="/images/front/newchat.png" style="margin-top:2px;">'
                                    +'          &nbsp;&nbsp;'+e.comments_num
                                    +'      </li>'
                                    +'  </ul>'
                                    +'   <ul class="" style="margin-top:2px">'
                                    +'       <li class="mf fl">课程数：<span  style="color:orange">'+e.class_count+'</span> </li>'
                                    +'      <li class="fl" style="margin-left:10px">|</li>'
                                    +'      <li class="bgrj fl">'
									+		       html                         
                            		+'		</li>'
                                    +'  </ul>'
                                    +'   <div class="clearfix"></div> '
                                    +'</div> ';
                            });
                           $("input[name=pages]").val(data.pages);
	                    $('.charge-l-three').append(str);
                        }else{
                            $("#getMores").html(data.msg);
                        }
                    }
                });
            });
        })
    </script>
        <div class="charge-right fr">
           <span class="rmtj">热门推荐</span>
          @foreach($teaches as $vo)
           <div class="charge-r">
               <span>
                 <a href="{{url('/teaches/'.$vo->id)}}">
                  <img src="@if(count($vo->attachment)>0){{$vo->attachment->url}}@else{{asset('/images/t-nopic.jpg')}}@endif" width="218" height="136">
                 </a>
               </span>
               <a href="{{url('/teaches/'.$vo->id)}}"><span class="charge-r-sm">{{$vo->name}}</span></a>
               <ul>
                   @if($vo->price)<li class="mfxl fl">{{$vo->price}}</li>@else<li class="mf fl color-11">免费</li>@endif
                   <li  class="fl">|</li>
                   <li  class="fl">@if(count($vo->categorys)>0){{$vo->categorys->cat_name}}@endif</li>
               </ul>
           </div>
         @endforeach
        </div>
    </div>
</div>
@stop
@section('footer')
    @parent
@stop